package c.c.c.a.o;

import android.annotation.SuppressLint;
import android.content.Context;
import b.i.b.f;
import c.c.c.a.i.c;
import c.c.c.a.n;
import com.huawei.hms.jos.games.ranking.RankingConst;
import org.json.JSONObject;

/* compiled from: CrashUploadManager */
public class a {
    @SuppressLint({"StaticFieldLeak"})
    public static volatile a b;
    public volatile Context a;

    public a(Context context) {
        this.a = context;
    }

    public void a(JSONObject jSONObject) {
        if (jSONObject != null && jSONObject.length() > 0) {
            try {
                n.c.a();
                Context context = n.a;
                c cVar = n.d;
                String str = "http://apmlog.snssdk.com/apm/collect/crash/";
                String j = f.j(f.g(this.a), String.format("anr_%s.npth", new Object[]{String.valueOf(System.nanoTime())}), str, jSONObject, true);
                jSONObject.put("upload_scene", RankingConst.RANKING_SDK_DIRECT);
                if (b.a(str, jSONObject.toString(), true).a()) {
                    f.x(j);
                }
            } catch (Throwable unused) {
            }
        }
    }
}
